<!--{*
/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
*}-->
<script language="JavaScript">
<!--
function lfnCheckSubmit( fm ){
	
	var err = '';
	/*
	if ( ! fm["title"].value ){
		err += '見出しコメントを入力して下さい。';
	}
	*/
	if ( ! fm["comment"].value ){
		if ( err ) err += '\n';
		err += 'オススメコメントを入力して下さい。';
	}
	if ( err ){
		alert(err);
		return false;
	} else {
		if(window.confirm('内容を登録しても宜しいですか')){
			return true;
		}
		return false;
	}
}

function lfnCheckSetItem( rank ){
	var flag = true;
	var checkRank = '<!--{$checkRank}-->';
	if ( checkRank ){
		if ( rank != checkRank ){
			if( ! window.confirm('さきほど選択した<!--{$checkRank}-->位の情報は破棄されます。宜しいでしょうか')){
				flag = false;
			}
		} 
	}
	
	if ( flag ){
		win03('./recommend_search.php?rank=' + rank,'search','500','500');
	}
}

//-->
</script>

<div id="alpha">
<div id="alpha-inner">
<!--▼SUB NAVI-->
<!--{include file=$tpl_subnavi}-->
<!--▲SUB NAVI-->
</div>
</div>



<div id="beta">
<div id="beta-inner">

<div class="title_page">
<h2><!--{$tpl_subtitle}--></h2>
</div>



<!--{section name=cnt loop=$tpl_disp_max}-->
<!--▼おすすめ<!--{$smarty.section.cnt.iteration}-->-->
<form name="form<!--{$smarty.section.cnt.iteration}-->" id="form<!--{$smarty.section.cnt.iteration}-->" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="regist">
<input type="hidden" name="product_id" value="<!--{$arrItems[$smarty.section.cnt.iteration].product_id|escape}-->">
<input type="hidden" name="category_id" value="<!--{$category_id|escape}-->">
<input type="hidden" name="rank" value="<!--{$arrItems[$smarty.section.cnt.iteration].rank|escape}-->">

<div class="menuclass">
<h3>
	商品名：<!--{$arrItems[$smarty.section.cnt.iteration].name|escape}-->｜
	<!--{if $arrItems[$smarty.section.cnt.iteration].product_id}-->
	<a href="#" onClick="return fnInsertValAndSubmit( document.form<!--{$smarty.section.cnt.iteration}-->, 'mode', 'delete', '削除します。宜しいですか' )">削除</a>｜
	<!--{/if}-->
	<a href="#" onclick="lfnCheckSetItem('<!--{$smarty.section.cnt.iteration}-->'); return false;" target="_blank">
	<!--{if $arrItems[$smarty.section.cnt.iteration].product_id}-->商品変更<!--{else}-->商品選択<!--{/if}--></a>
</h3>

<table summary="おすすめ商品">
<tr>
	<td align="center"><!--{$smarty.section.cnt.iteration}--></td>
	<td align="center">
	<!--{if $arrItems[$smarty.section.cnt.iteration].main_list_image != ""}-->
	<!--{assign var=image_path value="`$smarty.const.IMAGE_SAVE_URL`/`$arrItems[$smarty.section.cnt.iteration].main_list_image`"}-->
	<!--{else}-->
	<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_URL`"}-->
	<!--{/if}-->
	<img src="<!--{$image_path}-->" alt="商品写真" />
	</td>
		<td>
			オススメコメント：<br />
			<span class="red"><!--{$arrErr[$smarty.section.cnt.iteration].comment}--></span>
			<textarea name="comment" cols="45" rows="4" style="width: 337px; height: 82px;" <!--{$arrItems[$smarty.section.cnt.iteration].product_id|sfGetEnabled}-->><!--{$arrItems[$smarty.section.cnt.iteration].comment}--></textarea><br />
			<!--{if $arrItems[$smarty.section.cnt.iteration].product_id}-->
			<input type="submit" name="subm" value="登録する" onclick="return lfnCheckSubmit(document.form<!--{$smarty.section.cnt.iteration}-->);"/>
			<!--{/if}-->
		</td>
</tr>
</table>
</div>
</form>
<!--▲おすすめ<!--{$smarty.section.cnt.iteration}-->-->
<!--{/section}-->


</div>
</div>
